from django.urls import path

from app.ctrl.api import foo, auth, cashier_admin, goods, goods_class, \
    cart, test, order, goods_stock, member, member_funds, \
    sale, payment, ver, stats, return_goods, tool, \
    cockpit, deprecated, inventory, fix, ad, tbk

urlpatterns = [

    path('nav', foo.nav),
    path('login', auth.login),
    path('v2/login', auth.login_v2),
    path('reg', auth.reg),

    # 收银员
    path('cashier_info', cashier_admin.cashier_info),
    path('cashier_update_config', cashier_admin.update_config),
    path('handover', cashier_admin.handover),
    path('logout', cashier_admin.logout),
    path('sign_in', cashier_admin.sign_in),
    path('is_sign_in', cashier_admin.is_sign_in),

    # 会员
    path('member_detail', member.detail),
    path('member_query', member.query),
    path('member_create', member.create),
    path('member_update', member.update),

    # 会员资金
    path('storage_cards', member_funds.storage_cards),
    path('top_up', member_funds.top_up),

    # 商品
    path('goods_list', goods.goods_list),
    path('goods', goods.goods_detail),
    path('add_goods', goods.add_goods),
    path('update_goods', goods.update_goods),
    path('del_goods', goods.del_goods),
    path('query_goods', goods.query_goods),
    path('v2/query_goods', goods.query_goods_v2),
    path('add_barcode', goods.add_barcode),
    # 获取店铺饮品口味设置
    path('drinksetting', goods.drinksetting),
    # 店铺打印小票张数设置
    path('ticketsetting', goods.ticketsetting),
    # 获取店铺打印小票张数设置
    path('getticketsetting', goods.getticketsetting),
    # 获取店铺所有快餐和饮品类型的商品
    path('getfastfood', goods.getfastfood),
    # 获取店铺类型（是否是快餐店）与快餐店会员充值活动
    path('getshopinfo', goods.getshopinfo),
    # 快餐店会员充值
    path('chargefastballance', goods.chargefastballance),

    # 商品分类
    path('goods_class_list', goods_class.goods_class_list_v2),
    path('add_goods_class', goods_class.add_goods_class),
    path('update_goods_class', goods_class.update_goods_class),
    path('del_goods_class', goods_class.del_goods_class),

    # 购物车
    path('cart/goods_list', cart.goods_list),
    path('cart/add_goods', cart.add_goods),
    path('cart/add_goods_by_price', cart.add_goods_by_price),
    path('cart/update_goods', cart.update_goods),
    path('cart/del_goods', cart.del_goods),
    path('cart/retained', cart.retained),
    path('cart/retained_list', cart.retained_list),
    path('cart/del_cart', cart.del_cart),

    # 库存
    path('stock/add_goods', goods_stock.update_goods_v2),
    path('stock/update_goods', goods_stock.update_goods_v2),
    path('stock/submit_order', goods_stock.submit_order),
    path('stock/confirm_order', goods_stock.confirm_order),
    path('stock/goods_list', goods_stock.goods_list),

    # 订单
    path('order/checkout', order.checkout),
    path('order/create', deprecated.create_order),
    path('v2/order/create', order.create_v2),
    path('order/anti_settlement', order.anti_settlement),
    path('order/return_order_goods', order.return_order_goods),
    path('order/return_goods', order.return_goods),
    path('order/query_trade_state', order.sync_third_party_trade_state),

    # 销售单据
    path('sale_orders', sale.sale_orders),
    path('sale_order_detail', sale.sale_order_detail),
    path('mark_pay_err_order', sale.mark_pay_err_order),

    path('socket_test', foo.socket_test),
    path('send_msg', foo.send_msg),
    path('ts', foo.timestamp),
    path('bar', foo.bar),
    path('test', test.test),
    path('debug', test.debug),

    # 第三方支付
    path('query_pay_state', payment.query_pay_state),
    path('tp_pay', payment.pay),

    # 系统
    path('ver', ver.check),

    # 接口
    path('pay_refund', payment.refund),

    # 统计
    path('stats_sales', stats.sales),

    # 工具
    path('tool/sync_goods_barcode', foo.sync_goods_barcode),
    path('tool/sync_barcode_archives', foo.sync_barcode_archives),
    path('tool/query_pay_state', tool.query_pay_state),
    path('fix_sell_count', fix.fix_sell_count),
    path('git_local_ver', foo.git_local_ver),
    path('git', foo.git),
    path('git_update_ver_list', foo.git_update_ver_list),
    path('fix/cart_data', fix.cart_data),

    # 无单退货
    # path('return_goods', return_goods.no_order),
    path('return_goods', return_goods.no_order_v2),
    path('v3/return_goods', return_goods.no_order_v3),

    path('cockpit/order', cockpit.order_board),

    # 盘点
    path('inventory', inventory.inventory_info),
    path('inventory_list', inventory.inventory_list),
    path('create_inventory', inventory.create_inventory),
    path('inventory_goods_list', inventory.inventory_goods_list),
    path('save_inventory_detail', inventory.save_inventory_detail_v2),
    path('submit_inventory', inventory.submit_inventory),
    path('cancel_inventory', inventory.cancel_inventory),
    path('inventory_progress', inventory.inventory_progress),
    path('update_inventory_stats_data', inventory.update_inventory_stats_data),
    path('stats_inventory_goods', inventory.stats_inventory_goods),

    # 广告轮播
    path('ad_banner', ad.banner),

    # 淘宝客 弃
    path('tbk_dg_optimus_material', tbk.dg_optimus_material),
    path('tbk_dg_material_optional', tbk.dg_material_optional),
    path('tbk_sc_publisher_info_get', tbk.sc_publisher_info_get),
    path('tbk_sc_publisher_info_save', tbk.sc_publisher_info_save)

]
